#include <stdio.h>
/*
 * 该程序的目的：使用位图控制不同的功能实现
 */

#define ONE 0x1
#define TWO 0x2
#define THREE 0x4
#define FOUR 0x8
#define FIVE 0x10

//根据传的flag来实现不同的功能
void Print(int flag)
{
  if(flag & ONE) printf("hello1\n");
  if(flag & TWO) printf("hello2\n");
  if(flag & THREE) printf("hello3\n");
  if(flag & FOUR) printf("hello4\n");
  if(flag & FIVE) printf("hello5\n");
}

int main()
{
  //修改flag，你想要控制的功能
  printf("---------------------------------\n");
  int flag;
  flag = ONE;
  Print(flag);
  printf("---------------------------------\n");
  flag = ONE | TWO;
  Print(flag);
  printf("---------------------------------\n");

  flag = ONE | TWO | THREE;
  Print(flag);
  printf("---------------------------------\n");

  flag = ONE | TWO | THREE | FOUR;
  Print(flag);
  printf("---------------------------------\n");

  flag = ONE | TWO | THREE | FOUR | FIVE;
  Print(flag);

  return 0;
}
